
function logdata(){
	$.ajax({
		url:path+'/user/selectuser',
		type:'get',
		dataType:'json',
		success:function(res){
			$("#email").html(res.email)
			$("#phone").html(res.phone)
			$("#logintime").html(res.logintime)
			$("#logouttime").html(res.logout)
		},
		error:function(){
			layer.msg("连接失败")
		}
	})
}
function declarecounts(){
	$.ajax({
		url:'/total/counts',
		type:'get',
		data:{'fid':1,'state':2},
		dataType:'json',
		success:function(res){
			$("#declarecounts").html(res);
		},
		error:function(){
			layer.msg("连接失败")
		}
	})
}
function installcounts(){
	$.ajax({
		url:'/total/counts',
		type:'get',
		data:{'fid':2,'state':2},
		dataType:'json',
		success:function(res){
			$("#installcounts").html(res);
		},
		error:function(){
			layer.msg("连接失败")
		}
	})
}
function traincounts(){
	$.ajax({
		url:'/total/counts',
		type:'get',
		data:{'fid':3,'state':2},
		dataType:'json',
		success:function(res){
			$("#traincounts").html(res);
		},
		error:function(){
			layer.msg("连接失败")
		}
	})
}
function selectdeclare(){
	$.ajax({
		url:'/dec/selectdeclare',
		type:'get',
		dataType:'json',
		success:function(res){
			for (var i = 0; i < res.length; i++) {
				var content='';
				if(res[i].fid==1){
					content='<tr class="gradeX">'
	                       +'<td>'+res[i].customer+'</td>'
	                       +'<td>维修</td>'
	                       +'<td>'+res[i].startime+'</td>'
	                       +'</tr>';
				}
				if(res[i].fid==2){
					content='<tr class="gradeX">'
	                       +'<td>'+res[i].customer+'</td>'
	                       +'<td>安装</td>'
	                       +'<td>'+res[i].startime+'</td>'
	                       +'</tr>';
				}
				if(res[i].fid==3){
					content='<tr class="gradeX">'
	                       +'<td>'+res[i].customer+'</td>'
	                       +'<td>培训</td>'
	                       +'<td>'+res[i].startime+'</td>'
	                       +'</tr>';
				}
				
                 $("#declares").append($(content));
			}
		},
		error:function(){
			layer.msg('连接失败')
		}
	})
}
function selectReturns(){
	$.ajax({
		url:'/return/selectreturns',
		type:'get',
		dataType:'json',
		success:function(res){
			for (var i = 0; i < res.length; i++) {
				var content='';
				content='<tr class="gradeX">'
                    +'<td>'+res[i].customer+'</td>'
                    +'<td>退货</td>'
                    +'<td>'+res[i].startime+'</td>'
                    +'</tr>';
				$("#returns").append($(content));
			}
		},
		error:function(){
			layer.msg('连接失败')
		}
	})
}

